import request from '@/utils/request'

/**
 * 保存小区信息
 * @param data
 */
export function saveVillage(data) {
  return request({
    url: '/user/village/save',
    method: 'post',
    data: data
  })
}

/**
 * 删除小区信息
 * @param data
 */
export function deleteVillage(villageId) {
  return request({
    url: '/user/village/delete',
    method: 'post',
    params: { villageId }
  })
}

/**
 * 根据小区管理表id, 查询信息
 * @param memberId
 */
export function getVillage(villageId) {
  return request({
    url: '/user/village/getVillage',
    method: 'get',
    params: { villageId }
  })
}

// 小区分页
export function pagingVillage(query) {
  return request({
    url: '/user/village/paging',
    method: 'get',
    params: query
  })
}

// 查询所有小区
export function listVillageByEnterpriseId(enterpriseId) {
  return request({
    url: '/user/village/listVillageByEnterpriseId',
    method: 'get',
    params: { enterpriseId }
  })
}
